package com.city.itis.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;


/**
 * 会员信息JavaBean值类
 * @author WY
 *
 */
@Entity
@Table(name = "Member")
public class Member implements Serializable {
	private static final long serialVersionUID = 1L;
	private Integer id=null;		//会员编号
	private String memberId=null;	//会员账号
	private Integer memberCategoryNo=null;	//会员类别编号
	private MemberCategory category=new MemberCategory();		//会员级别
	private String nickName=null;		//昵称
	private String name=null;	//会员名称
	private String password=null; //密码
	private String sex=null;	//性别
    private String  birthday=null;		//出生日期
	private String address=null;		//联系地址
	private String email=null;		//邮箱
	private String tel=null;		//联系电话 
	private String mobilePhone=null;		//手机
	private String qq=null;		//QQ号码
	private Set<Hobby> hobbys;		//爱好对象
	private Integer loginCount=null;		//登录次数
	private Integer siteCount=null;		//添加站点次数
	private Integer level=null;	//会员级别
	private Date lastLoginDate=null;		//最后登录时间 
	private Date signupDate=null;		//注册时间
	private String  photoName=null;		//头像名称
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getMemberId() {
		return memberId;
	}
	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}
	@Transient
	public Integer getMemberCategoryNo() {
		return memberCategoryNo;
	}
	public void setMemberCategoryNo(Integer memberCategoryNo) {
		this.memberCategoryNo = memberCategoryNo;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@ManyToOne
	@JoinColumn(name="categoryId") 
	public MemberCategory getCategory() {
		return category;
	}
	public void setCategory(MemberCategory category) {
		this.category = category;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getBirthday() {
		return birthday;
	}
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public String getMobilePhone() {
		return mobilePhone;
	}
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}
	public String getQq() {
		return qq;
	}
	public void setQq(String qq) {
		this.qq = qq;
	}
	
	public Integer getLoginCount() {
		return loginCount;
	}
	
	 @ManyToMany(cascade = {CascadeType.ALL})
	 @JoinTable(
	           name="MemberHobby",
	           joinColumns=@JoinColumn(name="memberId"),
	          inverseJoinColumns=@JoinColumn(name="hobbyId")
	 )
	public Set<Hobby> getHobbys() {
		return hobbys;
	}
	public void setHobbys(Set<Hobby> hobbys) {
		this.hobbys = hobbys;
	}
	public void setLoginCount(Integer loginCount) {
		this.loginCount = loginCount;
	}
	public Integer getSiteCount() {
		return siteCount;
	}
	public void setSiteCount(Integer siteCount) {
		this.siteCount = siteCount;
	}
	
	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}

	public Date getLastLoginDate() {
		return lastLoginDate;
	}
	public void setLastLoginDate(Date lastLoginDate) {
		this.lastLoginDate = lastLoginDate;
	}
	public Date getSignupDate() {
		return signupDate;
	}
	public void setSignupDate(Date signupDate) {
		this.signupDate = signupDate;
	}
	public String getPhotoName() {
		return photoName;
	}
	public void setPhotoName(String photoName) {
		this.photoName = photoName;
	}
	

}
